package com.hnx.admin.aurora.system.controller;

import com.hnx.admin.aurora.annotation.Log;
import com.hnx.admin.aurora.enums.BusinessType;
import com.hnx.admin.aurora.system.domain.param.loginInfor.query.LoginInfoQuery;
import com.hnx.admin.aurora.system.service.LoginInfoService;
import com.hnx.admin.aurora.web.json.ResultJson;
import lombok.RequiredArgsConstructor;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/*
创建人： 倔强的头发
创建时间：2025/6/19
功能描述:

*/
@RestController
@RequiredArgsConstructor
@RequestMapping("/monitor/logininfor")
public class SysLoginInfoController {
    private final LoginInfoService loginInfoService;

    @PreAuthorize("@auth.hasPermi('monitor:logininfor:list')")
    @GetMapping("/list")
    public ResultJson list(LoginInfoQuery logininfor) {
        return loginInfoService.selectLogininforList(logininfor);
    }
    @PreAuthorize("@auth.hasPermi('monitor:logininfor:remove')")
    @Log(title = "登录日志", businessType = BusinessType.CLEAN)
    @DeleteMapping("/clean")
    public ResultJson clean()
    {
        return loginInfoService.cleanLogininfor();
    }
}
